package com.zmn.plat.manager.dictionary;

import com.zmn.common.dto.VtDTO;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 描述：渠道模塊字典
 *
 * @author wangjie
 * @version v1.0
 * @since 2019/1/3 15:21
 */
public class ChannelDict {

    public static final int ZERO = 0;
    public final static Integer HUNDRED = 100;
    public static final Integer STATUS_NORMAL = 2;
    public static final Integer STATUS_HIDDEN = 1;

    /**
     * 描述: 1 ,渠道操作日志 2, 押金操作日志3, 佣金操作日志
     */
    public final static int PLAT_CHANNEL_LOG_TYPE_CHANNELOPS = 1;
    public final static int PLAT_CHANNEL_LOG_TYPE_DEPOSIT = 2;
    public final static int PLAT_CHANNEL_LOG_TYPE_COMMISSIONOPS = 3;

    /**
     * 描述: 渠道日志记录字段
     *
     * @since 2019/1/3 17:54
     */
    public final static String PLAT_CHANGELOG_PROVINCE_ID = "provinceId";
    public final static String PLAT_CHANGELOG_CITY_ID = "cityId";
    public final static String PLAT_CHANGELOG_TYPE_ID = "typeId";
    public final static String PLAT_CHANGELOG_INDUSTRY_ID = "industryId";
    public final static String PLAT_CHANGELOG_LEVEL = "level";
    public final static String PLAT_CHANGELOG_CUSTOMER_TYPE = "customerType";
    public final static String PLAT_CHANGELOG_APPLIQUE = "applique";
    public final static String PLAT_CHANGELOG_PREPAY_TYPE = "prepayType";
    public final static String PLAT_CHANGELOG_HIDDEN = "hidden";
    public final static String PLAT_CHANGELOG_COMPANY_ID = "companyId";
    public final static String PLAT_CHANGELOG_PLATFORM_TYPE = "platformType";
    public final static String PLAT_CHANGELOG_PLATFORM_DEPART_ID = "departId";
    public final static String PLAT_CHANGELOG_PLATFORM_ABUTMENTER = "abutmenter";
    public final static String PLAT_CHANGELOG_PLATFORM_SALESMAN = "salesman";

    /**
     * 执行人类型：1本人，2自动，3管理者
     */
    public final static int ABUTMENTER_TYPE_OWNER = 1;
    public final static int ABUTMENTER_TYPE_AUTO = 2;
    public final static int ABUTMENTER_TYPE_MANAGER = 3;

    /**
     * scope:1,全国；2，城市
     */
    public final static int SCOPE_ALL = 1;
    public final static int SCOPE_CITY = 2;

    /**
     * CommissionType:1,按比例返佣；2，按固定金额返佣
     */
    public final static Integer COMMISSION_TYPE_BL = 1;
    public final static Integer COMMISSION_TYPE_GD = 2;

    /**
     * str
     */
    public final static String STR_ALL = "all";
    public final static String STR_UPDATE_DEPOSIT = "修改渠道押金";

    /**
     * 渠道平台类型：1-线上、2-线下
     */
    public final static int CHANNEL_PLATFORM_TYPE_UNDERLINE = 2;
    public final static int CHANNEL_PLATFORM_TYPE_ONLINE = 1;

    /**
     * 员工类型:5,平台
     */
    public final static int STAFF_PLAT = 5;

    /**
     * BASE_CODE_MAP:所属行业类型 1003
     */
    public final static int BASE_CODE_MAP_ONE_TYPE_INDUSTRY = 1003;

    /**
     * 所属中心：1024-厂家事业
     */
    public final static int CHANNEL_TYPE_ID_FACTORY = 1024;

    /**
     * 渠道类型：3-厂家渠道
     */
    public final static int CHANNEL_TYPE_FACTORY = 3;

    /**
     * 渠道层级：一级渠道
     */
    public final static int RANK_ONE = 1;

    /**
     * 渠道层级：二级渠道
     */
    public final static int RANK_TWO = 2;

    /**
     * 啄金客一级渠道ID
     */
    public final static int CPS_PARENTID = 32855;

    /**
     * 啄金客一级部门ID营销中心
     */
    public final static int CPS_ONE_DEPTID = 1009;
    public final static String CPS_ONE_DEPTNAME = "营销中心";

    /**
     * 啄金客一级部门ID营销中心-平台运营组
     */
    public final static int CPS_DEPTID = 2038;
    public final static String CPS_DEPTNAME = "用户运营部";

    public static final String[] CHANNEL_EXCEL_TITLE = {"渠道名称", "渠道类型", "别名", "是否允许贴花", "是否允许展示订单价格", "所属行业", "等级", "客户类型", "师傅查看提醒", "公司名称", "所在区域", "所在城市", "联系人", "联系电话", "渠道商规模描述", "是否有押金", "押金金额", "押金状态", "收款日期", "退还日期", "业务员", "运营人员", "部门", "是否渠道预收款",
            "是否允许后台录单", "工程款结算周期", "结算公司", "佣金结算周期", "银行卡:户名", "银行卡:开户支行", "银行卡:银行", "银行卡:银行卡号", "支付宝:姓名", "支付宝:支付宝账号", "微信:姓名", "微信:微信账号", "渠道财务对接人", "电话"};

    /**
     * 描述: 1 ,渠道操作日志 2, 押金操作日志
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getChannelLogType() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "渠道操作日志", true));
            add(new VtDTO(2, "押金操作日志", true));
            add(new VtDTO(3, "佣金操作日志", true));
        }};
    }

    /**
     * 描述: 平台类型：1其他，2线下，3线上
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getPlatformTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "平台类型", true));
            add(new VtDTO(2, "线下", true));
            add(new VtDTO(3, "线上", true));
        }};
    }

    /**
     * 描述:  翻译是否有押金 1,有 2 没有
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getDepositTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "有", true));
            add(new VtDTO(2, "没有", true));
        }};
    }

    /**
     * 描述:  状态：1未收，2已收，3已退
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getDepositStatusList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "未收", true));
            add(new VtDTO(2, "已收", true));
            add(new VtDTO(3, "已退", true));
        }};
    }

    /**
     * 描述:  佣金类型：1按比例返佣，2按固定金额返佣
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getCommissionTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "按比例返佣", true));
            add(new VtDTO(2, "按固定金额返佣", true));
        }};
    }

    public static String getFieldChNameByfieldColumName(String columName) {
        switch (columName) {
            case "channelId":
                return "渠道ID";
            case "typeId":
                return "渠道类型";
            case "plat":
                return "平台标志";
            case "name":
                return "渠道名称";
            case "fullName":
                return "全称";
            case "platformType":
                return "平台类型";
            case "hidden":
                return "是否允许后台录单";
            case "desc":
                return "师傅查看提醒";
            case "accessUrl":
                return "合作方入口地址";
            case "departId":
                return "所属部门";
            case "salesman":
                return "业务员";
            case "industryId":
                return "所属行业";
            case "abutmenter":
                return "运营人员";
            case "showOrderPrice":
                return "是否允许展示订单金额";
            case "receiveType":
                return "渠道是否收订单款";
            case "applique":
                return "是否允许贴花";
            case "level":
                return "渠道等级";
            case "performance":
                return "是否参与绩效考核";
            case "advanceType":
                return "预收款收款类型";
            case "billType":
                return "结算类型";
            case "realFlag":
                return "是否真实金额";
            case "provinceId":
                return "省";
            case "cityId":
                return "市";
            case "address":
                return "公司地址";
            case "contact":
                return "联系人";
            case "mobile":
                return "联系人电话1";
            case "phone":
                return "联系人电话2";
            case "scale":
                return "渠道商规模";
            case "status":
                return "状态";
            case "companyId":
                return "公司";
            case "prepayType":
                return "是否渠道预收款";
            case "anotherName":
                return "别名";
            case "customerType":
                return "客户类型";
            default:
                return "";

        }
    }

    /**
     * 描述:  佣金类型：1按比例返佣，2按固定金额返佣
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getAppliqueTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "不允许", true));
            add(new VtDTO(2, "允许", true));
        }};
    }

    /**
     * 描述:  工程款结算周期：1月结，2半月结，3周结，4T+1次日结
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getEngineeringPaymentCycleTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "月结", true));
            add(new VtDTO(2, "半月结", true));
            add(new VtDTO(3, "周结", true));
            add(new VtDTO(4, "次日结", true));
        }};
    }

    /**
     * 描述:  结算公司：1总公司收款，2子公司收款
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getClearingCorporationTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "总公司收款", true));
            add(new VtDTO(2, "子公司收款", true));
        }};
    }

    /**
     * 描述:  佣金结算周期：1月结，2季结，3年结
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getCommissionPaymentCycleTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "月结", true));
            add(new VtDTO(2, "季结", true));
            add(new VtDTO(3, "年结", true));
        }};
    }

    /**
     * 描述:  是否允许贴花：1不允许，2允许
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static List<VtDTO> getIsAppliqueTypeList() {
        return new ArrayList<VtDTO>(3) {{
            add(new VtDTO(1, "不允许", true));
            add(new VtDTO(2, "允许", true));
        }};
    }

    /**
     * 描述:  是否允许贴花：1不允许，2允许（返回map字典）
     *
     * @author wangjie
     * @since 2018/10/30 10:14
     */
    public static Map<Integer, String> getIsAppliqueTypeMap() {
        return getIsAppliqueTypeList().stream().collect(Collectors.toMap(VtDTO::getValue, VtDTO::getText));
    }

    public static String getChannelTypeName(int channelType) {
        switch (channelType) {
            case 1:
                return "政企渠道";
            case 2:
                return "商家渠道";
            case 3:
                return "厂家渠道";
            case 4:
                return "自有渠道";
            case 5:
                return "推广渠道";
            case 6:
                return "服务商渠道";
            default:
                return "";
        }
    }
}
